package com.hd.assistant.dal.dao;

import java.util.List;

import com.hd.assistant.dal.dao.exception.DAOException;
import com.hd.assistant.dal.dao.query.ClickedDetailQuery;
import com.hd.assistant.dal.dataobject.ClickedDetail;

public interface ClickedDetailDAO {
 
	
	void insertClickedDetail(ClickedDetail item) throws DAOException;

	ClickedDetail getNearestByClickedId(String clickedId)throws DAOException;
	
	/**
	 * 根据日期和clickId  增点击次数 由sql语句完成 mysql本身排他锁保证并发性
	 * clickId clickdate不容许为空
	 * @param query
	 * @return
	 * @throws DAOException
	 */
	int updateClickedNumsByItemidAndDate(String clickId,String clickedDate,int needToaddNum)throws DAOException;
	
	public List<ClickedDetail> getAllDetailsByQuery(ClickedDetailQuery query)throws DAOException;
	
	public List<ClickedDetail> getAllDetailsGroupByByItemidAndUserId(ClickedDetailQuery query)throws DAOException;
	
	public List<ClickedDetail> getAllDetailsGroupByByClickedDateAndUserId(ClickedDetailQuery query)throws DAOException;
}
